package io.renren.modules.reception.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.renren.modules.reception.entity.TStoreFastfoodRecordEntity;
import io.renren.modules.reception.entity.vo.ReserveVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;

import io.renren.modules.reception.dao.TStoreReserveDeskDao;
import io.renren.modules.reception.entity.TStoreReserveDeskEntity;
import io.renren.modules.reception.service.TStoreReserveDeskService;


@Service("tStoreReserveDeskService")
public class TStoreReserveDeskServiceImpl extends ServiceImpl<TStoreReserveDeskDao, TStoreReserveDeskEntity> implements TStoreReserveDeskService {

    @Autowired
    private TStoreReserveDeskDao storeReserveDeskDao;
    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<TStoreReserveDeskEntity> page = this.page(
                new Query<TStoreReserveDeskEntity>().getPage(params),
                new QueryWrapper<TStoreReserveDeskEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public Page<TStoreReserveDeskEntity> listReserveDesk(Map<String, Object> params) {
        Page<TStoreReserveDeskEntity> page = new Page<TStoreReserveDeskEntity>
                (Long.parseLong((String) params.get("current")),Long.parseLong((String) params.get("size")));
        return storeReserveDeskDao.listReserveDesk(page,params);
    }

    @Override
    public ReserveVo total(Map<String, Object> map) {
        return storeReserveDeskDao.total(map);
    }

}